package com.example.myhuangye.call;

import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;

import com.example.myhuangye.R;

/**
 * Created by lc on 2017/4/18.
 */

public class Dialog extends DialogFragment{
//    private EditText pass;
//    private EditText username;
    private getEditTexts get;

    @Override
    public android.app.Dialog onCreateDialog(Bundle savedInstanceState) {
        AlertDialog alertDialog=new AlertDialog.Builder(getActivity()).setPositiveButton("确定", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                get= (getEditTexts) getActivity();
//                get.texts(username.getText().toString().trim(),pass.getText().toString().trim());
            }
        }).create();
//        View view=View.inflate(getActivity(), R.layout.dialog,null);
//        alertDialog.setView(view);
        WindowManager.LayoutParams layoutParams= alertDialog.getWindow().getAttributes();
        layoutParams.alpha=0.5f;
//        pass= (EditText) view.findViewById(R.id.id_txt_password);
//        username= (EditText)view.findViewById(R.id.id_txt_username);
        return alertDialog;
    }

    public interface getEditTexts{
        void texts(String name, String pass);
    }
}
